module.exports = {
  // 开发服务器设置
  devServer: {
    open: true,
    // 设置 npm run serve 启动后的端口号
    port: 3000,
    // 如果你开始了eslint,不要让eslint在页面中遮罩，它错误会在console.log控制台打印
    overlay: false,
    // vue项目代理请求
    proxy: {
      '/api/getCaptcha': {
        target: 'https://reactapi.iynn.cn/captcha/api',
        changeOrigin: true,
        pathRewrite: {
          '/api/getCaptcha': '',
        },
      },
      '/api/checkCaptcha': {
        target: 'https://reactapi.iynn.cn/api/common/captcha/verify',
        changeOrigin: true,
        pathRewrite: {
          '/api/checkCaptcha': '',
        },
      },
      '/api/login': {
        target: 'https://reactapi.iynn.cn/api/common/auth/login',
        changeOrigin: true,
        pathRewrite: {
          '/api/login': '',
        },
      },
      '/api/getManager': {
        target: 'https://reactapi.iynn.cn/api/common/auth/adminInfo',
        changeOrigin: true,
        pathRewrite: {
          '/api/getManager': '',
        },
      },
      '/api/getusers': {
        target: 'https://reactapi.iynn.cn/api/users',
        changeOrigin: true,
        pathRewrite: {
          '/api/getusers': '',
        },
      },
      '/api/adduser': {
        target: 'https://reactapi.iynn.cn/api/users/add',
        changeOrigin: true,
        pathRewrite: {
          '/api/adduser': '',
        },
      },
      '/api/userinfo': {
        target: 'https://reactapi.iynn.cn/api/users',
        changeOrigin: true,
        pathRewrite: {
          '/api/userinfo': '',
        },
      },
      '/api/moduser': {
        target: 'https://reactapi.iynn.cn/api/users',
        changeOrigin: true,
        pathRewrite: {
          '/api/moduser': '',
        },
      },
      '/api/deluser': {
        target: 'https://reactapi.iynn.cn/api/users',
        changeOrigin: true,
        pathRewrite: {
          '/api/deluser': '',
        },
      },
    },
  },
}
